<?php

namespace maotool\core\console\command;

use maotool\core\console\Command;
use maotool\util\NpmUtil;
use maotool\util\PathUtil;

class Wechat extends Command
{

    public function getName()
    {
        // TODO: Implement getName() method.
    }

    public function getDescription()
    {
        // TODO: Implement getDescription() method.
    }

    public function getHelp($argv = [])
    {
        return "wechat 微信管理";
    }

    public function getUsage($argv = [])
    {
        // TODO: Implement getUsage() method.
    }

    public function isHit($argv = [])
    {
        if (count($argv) > 1 && $argv[1] == "wechat") {
            return true;
        }
        return false;
    }

    public function handle($argv = [])
    {
        if (isset($argv[2]) && $argv[2] = "mini-ci-install") {
            echo "cd " . PathUtil::path("maotool:/src/main/php/maotool/wechat/mini/ci") . " && npm install\n";
            echo NpmUtil::install("maotool:/src/main/php/maotool/wechat/mini/ci/package.json");
        }
    }


}